export const actions = {
    getTotalTraffic() {
        // return this.$api.dashBoard.getTotalTraffic().then((res) => {
        //     return Promise.resolve(res.data)
        // }, (error) => {
        //     return Promise.reject(error)
        // }).catch((error) => {
        //     return Promise.reject(error)
        // })

        return Promise.resolve([
            {
                out: 40.92,
                in: 50.54
            }
        ])
    },
    getMaliciousTraffic() {
        // this.$api.dashBoard.getTotalTraffic().then((res) => {

        // }, (error) => {

        // })
        let obj = []
        for(let i = 0; i < 50; i++){
            let temp = {}
            temp.time = i
            temp.count = Math.random() * 50 + 50
            obj.push(temp)
        }
        console.log(obj)
        return Promise.resolve(obj)
    },
    getBenignTraffic() {
        // this.$api.dashBoard.getTotalTraffic().then((res) => {

        // }, (error) => {

        // })
        let obj = []
        for(let i = 0; i < 50; i++){
            let temp = {}
            temp.time = i
            temp.count = Math.random() * 50 + 50
            obj.push(temp)
        }
        console.log(obj)
        return Promise.resolve(obj)
    },
    getMaliciousRecord() {
        return Promise.resolve([
            {ip: '124.115.0.24', time: '12:48', count: 5},
            {ip: '203.209.236.14', time: '12:48', count: 8},
            {ip: '61.135.152.24', time: '12:48', count: 7},
            {ip: '220.181.34.215', time: '12:48', count: 3},
            {ip: '159.226.40.7', time: '12:48', count: 6},
            {ip: '202.106.182.157', time: '12:48', count: 9},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10}
        ])
    },
    getBenignRecord() {
        return Promise.resolve([
            {ip: '119.75.217.109', time: '12:48', count: 7},
            {ip: '157.55.39.132', time: '12:48', count: 6},
            {ip: '61.132.163.68', time: '12:48', count: 3},
            {ip: '219.141.136.10', time: '12:48', count: 8},
            {ip: '218.85.152.99', time: '12:48', count: 5},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10},
            {ip: '127.0.0.1', time: '12:48', count: 10}
        ])
    },
    getDeviceInfo() {
        // return this.$api.dashBoard.getDeviceInfo().then((res) => {
        //     return Promise.resolve(res.data)
        // }, (error) => {
        //     return Promise.reject(error)
        // }).catch((error) => {
        //     return Promise.reject(error)
        // })

        return Promise.resolve({
            cpu: 0.35,
            gpu: 0.42,
            memory: 0.56
        })
    }
}